********************************************************************************
*********						 FIG 6	- ESTIMATED DISTRIBUTION 	   *********
*********							OF VALUE OF TIME AND URGENCY       *********
********************************************************************************
 
use ".\preparation\acct_by_acct_noMP5_wvor (1).dta",clear
*use ".\data\temp\acct_by_acct_noMP5_wvor.dta",clear
drop if urgencyse==0 & VOTse==0 & VORse==0
*** URGENCY
kdensity urgency if urgency>-2&urgency<8, kernel(epa) gen(x1 epa1) bw(.5) nograph
graph twoway (line epa1 x1, lcolor(black) lpattern(dash) ytitle(Smoothed Density) ///
  xtitle("Value of Urgency (in dollars per hour)")  xlabel(-2(2)8) xsc(r(-2 8)) scheme(s1mono) ///
  plotregion(style(none))), legend(off)  name(panela, replace)

*** VALUE OF TIME
kdensity VOT if VOT>-10&VOT<30, kernel(epa) gen(x2 epa2) bw(.5) nograph
graph twoway (line epa2 x2, lcolor(black) lpattern(dash) ytitle(Smoothed Density) ///
  xtitle("Value of Time (in dollars per hour)")  xlabel(-10(10)30) xsc(r(-10 30)) scheme(s1mono) ///
  plotregion(style(none))), legend(off) name(panelb, replace)

*** VALUE OF RELIABILITY
kdensity VOR if VOR>-50&VOR<100, kernel(epa) gen(x3 epa3) bw(5) nograph
graph twoway (line epa3 x3, lcolor(black) lpattern(dash) ytitle(Smoothed Density) ///
  xtitle("Value of Reliability (in dollars per hour)")  xlabel(-50(25)100) ///
  xsc(r(-50 100)) scheme(s1mono) ///
  plotregion(style(none))), legend(off)  name(panelc, replace)

 graph combine panela panelb panelc, col(2)
 graph export .\results\maintablesfigs\figs\fig6.png, replace
putexcel set ".\results\maintablesfigs\maintextFigsTabs.xlsx", sheet("Figure 6") modify
graph close
